function parseURL(url) {
    return {
        source: url,
        params: (function(){
            var ret = {},
                seg = url.split('#')[1].split('&'),
                len = seg.length, i = 0, s;
            for (;i<len;i++) {
                if (!seg[i]) { continue; }
                s = seg[i].split('=');
                ret[s[0]] = s[1];
            }
            return ret;
        })()
    };
}
function getAccessTokenFromURL(url) {
    return parseURL(url).params["access_token"];
}

function getUserIdFromURL(url) {
    return parseURL(url).params["user_id"];
}

function getPath(fullPath, fileName) {
    return fullPath.replace('/' + fileName, '');
}